﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%--
<script type="text/javascript">
    function saveStaffInfo() {
        var staff_id = $("#staff_id").val();
        var staff_name = $("#staff_name").val();
        var dept_id = $("#dept_id").val();
        var duty_id = $("#duty_id").val();
        var staff_sex = $("#staff_sex").val();
        var staff_homeaddr = $("#staff_homeaddr").val();
        var staff_officeaddr = $("#staff_officeaddr").val();
        var staff_sfz = $("#staff_sfz").val();
        var staff_postnum = $("#staff_postnum").val();
        var staff_marrige = $("#staff_marrige").val();
        var staff_study = $("#staff_study").val();
        var staff_school = $("#staff_school").val();
        var staff_major = $("#staff_major").val();
        var staff_politics = $("#staff_politics").val();
        var staff_birth = $("#staff_birth").val();
        var staff_interest = $("#staff_interest").val();
        var staff_zybl = $("#staff_zybl").val();
        var staff_liveaddr = $("#staff_liveaddr").val();
        var staff_livenum = $("#staff_livenum").val();
        var staff_mobile = $("#staff_mobile").val();
        var staff_shortnum = $("#staff_shortnum").val();
        var staff_officenum = $("#staff_officenum").val();
        var staff_rzsj = $("#staff_rzsj").val();
        var staff_lxr = $("#staff_lxr").val();
        var staff_lxrphone = $("#staff_lxrphone").val();
        var staff_jsr = $("#staff_jsr").val();
        var staff_gzjl = $("#staff_gzjl").val();
        var staff_jtcy = $("#staff_jtcy").val();
        var staff_email = $("#staff_email").val();
        var staff_qq = $("#staff_qq").val();
        var staff_fax = $("#staff_fax").val();
        var staff_height = $("#staff_height").val();
        var staff_nation = $("#staff_nation").val();
        var staff_sygz = $("#staff_sygz").val();
        var staff_zzgz = $("#staff_zzgz").val();
        var staff_sfsb = $("#staff_sfsb").val();
        var staff_code = $("#staff_code").val();
        var staff_descn = $("#staff_descn").val();
        var staff_ctime = $("#staff_ctime").val();
        var staff_fjh = $("#staff_fjh").val();
        var staff_erp = $("#staff_erp").val();
        var staff_empsw = $("#staff_empsw").val();
        var staff_kybz = $("#staff_kybz").val();

        $.ajax({
            type: "POST",
            url: "/Basic/DoStaffUpdate",
            data: { "staff_id": staff_id, "staff_name": staff_name, "dept_id": dept_id, "duty_id": duty_id, "staff_sex": staff_sex, "staff_homeaddr": staff_homeaddr,
                "staff_sfz": staff_sfz, "staff_postnum": staff_postnum, "staff_marrige": staff_marrige, "staff_study": staff_study, "staff_school": staff_school, "staff_major": staff_major,
                "staff_politics": staff_politics, "staff_birth": staff_birth, "staff_interest": staff_interest, "staff_zybl": staff_zybl, "staff_liveaddr": staff_liveaddr, "staff_livenum": staff_livenum, "staff_mobile": staff_mobile,
                "staff_shortnum": staff_shortnum, "staff_officenum": staff_officenum, "staff_rzsj": staff_rzsj, "staff_lxr": staff_lxr, "staff_lxrphone": staff_lxrphone, "staff_jsr": staff_jsr,
                "staff_gzjl": staff_gzjl, "staff_jtcy": staff_jtcy, "staff_email": staff_email, "staff_qq": staff_qq, "staff_fax": staff_fax, "staff_height": staff_height, "staff_nation": staff_nation,
                "staff_sygz": staff_sygz, "staff_zzgz": staff_zzgz, "staff_sfsb": staff_sfsb, "staff_code": staff_code, "staff_descn": staff_descn, "staff_ctime": staff_ctime, "staff_fjh": staff_fjh,
                "staff_erp": staff_fjh, "staff_empsw": staff_empsw, "staff_kybz": staff_kybz
            },
            success: function(restag) {
                if (restag.res != true) {
                    alert(restag.msg);
                }
                else {
                    alert("操作成功");
                    $.fn.deltab('6-2-1');
                    $('#menu_userlist').trigger('click');
                }
            }
        });
    }
</script>--%>

<script type="text/javascript">
    function submits() {
        var staff_name = $("#staff_name").val();
        var staff_sex = $("#staff_sex").val();
        var dept_id = $("#dept_id").val();
        var duty_id = $("#duty_id").val();
        if ("" == staff_name) {
            alert("名称不能为空！");
            return false;
        }
        if ("" == staff_sex) {
            alert("请选择性别！");
            return false;
        }

        if ("" == dept_id) {
            alert("请选择部门！");
            return false;
        }
        if ("" == duty_id) {
            alert("请选择职位！");
            return false;
        }
        return true;

    };

    function proRes(ajaxContext) {
        //        var restag = {};
        //        try {
        //            restag = ajaxContext.get_response().get_object();
        //        } catch (e) {
        //            alert("程序出现错误，请联系管理员");
        //            return;  // return if result is not json
        //        }
        var restag = {};
        try {
            var restag = eval(ajaxContext);
        } catch (e) {
            alert("程序出现错误，请联系管理员");
            return;  // return if result is not json
        }

        if (restag.res != true) {
            alert(restag.msg);
            return;
        }
        else {
            alert("操作成功");
            $('#menu_allstafflist').trigger('click');
            $.fn.deltab('staff-1-1');
        }
    }
</script>

<script type="text/javascript">
    $(function() {
        var addorupdateStaffoptions = {
            url: '/Basic/DoStaffAddOrUpdate',
            type: 'POST',
            success: function(data) {
                proRes(data);
            }
        };
        $('#frmaddorupdateStaff').ajaxForm(addorupdateStaffoptions);
    });
</script>

<div id="userinfo">
    <fieldset>
        <%using (Html.BeginForm("DoStaffAddOrUpdate", "Basic", FormMethod.Post, new { id = "frmaddorupdateStaff" }))
          { %>
        <div style="width: 100%;">
            <input type="submit" value="保存" onclick="return submits();" style="margin-top: 5px;" /></div>
        <div>
            <%= Html.Hidden("staff_id", ViewData["staff_id"])%><%= Html.Hidden("staff_ctime", ViewData["staff_ctime"])%></div>
        <div style="margin-left: 10px; margin-top: 20px; width: 320px; float: left">
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">员工编码:</span>
                <%= Html.TextBox("staff_code", ViewData["staff_code"], new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">员工名称:</span>
                <%= Html.TextBox("staff_name", ViewData["staff_name"], new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">家庭住址:</span>
                <%= Html.TextBox("staff_homeaddr", ViewData["staff_homeaddr"], new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">办公地址:</span>
                <%= Html.TextBox("staff_officeaddr", ViewData["staff_officeaddr"], new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">毕业学校:</span>
                <%= Html.TextBox("staff_school", ViewData["staff_school"], new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">政治面貌:</span>
                <%= Html.TextBox("staff_politics", ViewData["staff_politics"], new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">出生日期:</span>
                <%= Html.TextBox("staff_birth", ViewData["staff_birth"], new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">身 份 证:</span>
                <%= Html.TextBox("staff_sfz", ViewData["staff_sfz"], new { @style = "width:200px; margin-left:11px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">婚 否:</span>
                <%= Html.TextBox("staff_marrige", ViewData["staff_marrige"], new { @style = "width:200px; margin-left:30px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">学 历:</span>
                <%= Html.TextBox("staff_study", ViewData["staff_study"], new { @style = "width:200px; margin-left:30px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">专 业:</span>
                <%= Html.TextBox("staff_major", ViewData["staff_major"], new { @style = "width:200px; margin-left:30px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">民 族:</span>
                <%= Html.TextBox("staff_nation", ViewData["staff_nation"], new { @style = "width:200px; margin-left:30px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">身 高:</span>
                <%= Html.TextBox("staff_height", ViewData["staff_height"], new { @style = "width:200px; margin-left:30px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">部 门:</span>
                <%=Html.DropDownList("dept_id", ViewData["list_dept"] as List<SelectListItem>, new { @style = "width:202px; margin-left:30px; padding:0px;border-radius:0px 0px 0px 0px;border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">职 位:</span>
                <%=Html.DropDownList("duty_id", ViewData["list_duty"] as List<SelectListItem>, new { @style = "width:202px; margin-left:30px; padding:0px;border-radius:0px 0px 0px 0px;border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">性 别:</span>
                <%=Html.DropDownList("staff_sex", ViewData["list_sex"] as List<SelectListItem>, new { @style = "width:202px; margin-left:30px; padding:0px;border-radius:0px 0px 0px 0px;border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">在职标志:</span>
                <%=Html.DropDownList("staff_kybz", ViewData["list_kybz"] as List<SelectListItem>, new { @style = "width:202px; margin-left:10px; padding:0px;border-radius:0px 0px 0px 0px;border:solid 1px #6C92AD;" })%></p>
        </div>
        <div style="margin-top: 20px; : 10px; width: 320px; float: left">
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">邮箱:</span>
                <%= Html.TextBox("staff_email", ViewData["staff_email"], new { @style = "width:200px; margin-left:34px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">邮箱密码:</span>
                <%= Html.TextBox("staff_empsw", ViewData["staff_empsw"], new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">Q Q:</span>
                <%= Html.TextBox("staff_qq", ViewData["staff_qq"], new { @style = "width:200px; margin-left:34px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">传真:</span>
                <%= Html.TextBox("staff_fax", ViewData["staff_fax"], new { @style = "width:200px; margin-left:34px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">邮编:</span>
                <%= Html.TextBox("staff_postnum", ViewData["staff_postnum"], new { @style = "width:200px; margin-left:34px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">住宅电话:</span>
                <%= Html.TextBox("staff_livenum", ViewData["staff_livenum"], new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">手机:</span>
                <%= Html.TextBox("staff_mobile", ViewData["staff_mobile"], new { @style = "width:200px; margin-left:34px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">短号:</span>
                <%= Html.TextBox("staff_shortnum", ViewData["staff_shortnum"], new { @style = "width:200px; margin-left:34px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">办公电话:</span>
                <%= Html.TextBox("staff_officenum", ViewData["staff_officenum"], new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">分 机 号:</span>
                <%= Html.TextBox("staff_fjh", ViewData["staff_fjh"], new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">入职时间:</span>
                <%= Html.TextBox("staff_rzsj", ViewData["staff_rzsj"], new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">试用工资:</span>
                <%= Html.TextBox("staff_sygz", ViewData["staff_sygz"], new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">转正工资:</span>
                <%= Html.TextBox("staff_zzgz", ViewData["staff_zzgz"], new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">社保信息:</span>
                <%= Html.TextBox("staff_sfsb", ViewData["staff_sfsb"], new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">联系人:</span>
                <%= Html.TextBox("staff_lxr", ViewData["staff_lxr"], new { @style = "width:200px; margin-left:22px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">联系人电话:</span>
                <%= Html.TextBox("staff_lxrphone", ViewData["staff_lxrphone"], new { @style = "width:200px; margin-left:-4px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">ERP账号:</span>
                <%= Html.TextBox("staff_erp", ViewData["staff_erp"], new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
        </div>
        <div style="margin-top: 20px; margin-left: 10px; width: 320px; float: left">
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">家庭成员:</span>
                <%= Html.TextArea("staff_jtcy", ViewData["staff_jtcy"] == null ? "" : ViewData["staff_jtcy"].ToString(), new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">其 它:</span>
                <%= Html.TextArea("staff_descn", ViewData["staff_descn"] == null ? "" : ViewData["staff_descn"].ToString(), new { @style = "width:200px; margin-left:30px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">主要经历:</span>
                <%= Html.TextArea("staff_zybl", ViewData["staff_zybl"] == null ? "" : ViewData["staff_zybl"].ToString(), new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">现居地址:</span>
                <%= Html.TextArea("staff_liveaddr", ViewData["staff_liveaddr"] == null ? "" : ViewData["staff_liveaddr"].ToString(), new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">介绍关系:</span>
                <%= Html.TextArea("staff_jsr", ViewData["staff_jsr"] == null ? "" : ViewData["staff_jsr"].ToString(), new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">工作经历:</span>
                <%= Html.TextArea("staff_gzjl", ViewData["staff_gzjl"] == null ? "" : ViewData["staff_gzjl"].ToString(), new { @style = "width:200px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
            <p style="margin: 10px 0;">
                <span style="padding-left: 25px;">兴 趣:</span>
                <%= Html.TextArea("staff_interest", ViewData["staff_interest"] == null ? "" : ViewData["staff_interest"].ToString(), new { @style = "width:200px; margin-left:30px; border:solid 1px #6C92AD;" })%></p>
        </div>
        <%} %>
        <br />
    </fieldset>
</div>
